#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2018/2/1 18:08
# @Author  : Aries
# @Site    : 
# @File    : ClipWithSnap.py
# @Software: PyCharm Community Edition

def ClipRaster():
    """
    ##Clip Raster Dataset by known extent - Left Bottom Right Top
    :return:
    """
    import arcpy
    arcpy.env.workspace = "D:\MasterGo\\thesis\data\LandsatData\\6Satmos"

    # Set Snap Raster environment
    #arcpy.env.snapRaster = "LC08_L1TP_150033_20160227_20170329_01_Radian_clip.tif"
    # radimg = "LC08_L1TP_150033_20160227_20170329_01_Radian.dat"
    toaimg = "LC08_L1TP_150033_20160227_20170329_01_TOA_6s.tif"
    # dem = "Fill_clip_Gaiz_toUTM_30m.tif"
    clipshp = "catchment_line_to_Polygon.shp"
    outimg = "LC08_20160227_TOA_6s_clip.tif"
    # outdem = "Fill_clip_Gaiz_toUTM_30m_snaped.tif"
    arcpy.Clip_management(toaimg, "#", outimg, in_template_dataset = clipshp, clipping_geometry="ClippingGeometry")



if __name__ == '__main__':
    ClipRaster()